Skip to content

Fix index duplication#10671

Merged
max-sixty merged 14 commits into
pydata:mainfrom
dylanhmorris:fix-index-duplication
Sep 25, 2025
Merged

Fix index duplication#10671
max-sixty merged 14 commits into
pydata:mainfrom
dylanhmorris:fix-index-duplication

Conversation

@dylanhmorris
Copy link
Copy Markdown
Contributor

@dylanhmorris dylanhmorris commented Aug 26, 2025

I would be grateful for confirmation from someone more experienced with the codebase that my reasoning here is correct:

xarray/xarray/core/dataset.py

Lines 7186 to 7188 in ff03b8a

# All and only non-index arrays (whether data or coordinates) should
# become columns in the output DataFrame. Excluding indexes rather
# than dims handles the case of a MultiIndex along a single dimension.

@welcome
Copy link
Copy Markdown

welcome Bot commented Aug 26, 2025

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

Comment thread xarray/core/dataset.py Outdated
@dylanhmorris
Copy link
Copy Markdown
Contributor Author

Anything else needed for review?

@max-sixty max-sixty added the plan to merge Final call for comments label Sep 14, 2025
@max-sixty
Copy link
Copy Markdown
Collaborator

max-sixty commented Sep 14, 2025

looks good! will merge on the next ping or if anyone else sees it

thank you @dylanhmorris !

Comment thread xarray/core/dataset.py Outdated
@max-sixty max-sixty removed the plan to merge Final call for comments label Sep 15, 2025
@dylanhmorris
Copy link
Copy Markdown
Contributor Author

@dcherian is this now good to go?

@max-sixty max-sixty merged commit 2b947e9 into pydata:main Sep 25, 2025
35 of 37 checks passed
@welcome
Copy link
Copy Markdown

welcome Bot commented Sep 25, 2025

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset.to_dataframe() and DataArray.to_dataframe() convert multi-index levels both to pandas MultiIndex and to columns

3 participants